home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_mc.idb / usr / freeware / lib / mc / mc.ext.z / mc.ext
Encoding:
Text File  |  1998-10-28  |  14.0 KB  |  573 lines

  1. # Midnight Commander 3.0 extension file
  2. # Warning: Structure of this file has changed completely with version 3.0
  3. #
  4. # All lines starting with # or empty lines are thrown away.
  5. # Lines starting in the first column should have following format:
  6. #
  7. # keyword/descNL, i.e. everything after keyword/ until new line is desc
  8. #
  9. # keyword can be: 
  10. #
  11. #    shell (desc is, when starting with a dot, any extension (no wildcars), 
  12. #          i.e. matches all the files *desc . Example: .tar matches *.tar;
  13. #          if it doesn't start with a dot, it matches only a file of that name)
  14. #
  15. #    regex (desc is a regular expression)
  16. #          Please note that we are using the GNU regex library and thus
  17. #          \| matches the literal | and | has special meaning (or) and
  18. #          () have special meaning and \( \) are standing for literal ( ).
  19. #
  20. #    type  (file matches this if `file %f` matches regular expression desc
  21. #          (the filename: part from `file %f` is removed))
  22. #
  23. #    directory (matches any directory matching regular expression desc)
  24. #
  25. #    include (matches an include directive)
  26. #
  27. #    default (matches any file no matter what desc is)
  28. #
  29. # Other lines should start with a space or tab and should be of the format:
  30. #
  31. # keyword=commandNL (with no spaces around =), where keyword should be: 
  32. #
  33. #    Open (if the user presses Enter or doubleclicks it), 
  34. #
  35. #    View (F3), Edit (F4), Drop (user drops some files on it) or any other
  36. #
  37. #    user defined name (those will be listed in the extension dependent pop-up
  38. #    menu). 
  39. #
  40. #    Icon name is name of the corresponding icon (XPM). If it has no path,
  41. #    the default path for mc icons /usr/freeware/lib/mc/icons is assumed.
  42. #
  43. #    Title is the default icon title for objects. %p is expanded into the
  44. #    name of that file and %d/%p to a name with full path. Default title
  45. #    (if none is specified) is %p
  46. #
  47. #    Include is the keyword used to add any further entries from an include/
  48. #    section
  49. #
  50. # command is any one-line shell command, with the following substitutions:
  51. #
  52. # %% -> % character
  53. # %p -> name of the current file (without path, but pwd is its path)
  54. # %f -> name of the current file. Unlike %p, if file is located on a 
  55. #    non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
  56. #    then the file will be temporarily copied into a local directory
  57. #    and %f will be the full path to this local temporal file.
  58. #    If you don't want to get a local copy and want to get the
  59. #    virtual fs path (like ftp://ftp.cvut.cz/pub/hungry/xword), then
  60. #    use %d/%p instead of %f.
  61. # %d -> name of the current directory (pwd, without trailing slash)
  62. # %s -> "selected files", i.e. space separated list of tagged files if any
  63. #       or name of the current file
  64. # %t -> list of tagged files
  65. # %u -> list of tagged files (they'll be untaged after the command)
  66. #
  67. # (If these 6 letters are in uppercase, they refer to the other panel.
  68. # But you shouldn't have to use it in this file.)
  69. #
  70. #
  71. # %cd -> the rest is not command, but a path which will mc cd internally
  72. #       into (cd wouldn't work, since it is a child process, and %cd handles 
  73. #       even the vfs names (e.g. tar:archive.tar/path or
  74. #       ftp://tsx-11.mit.edu/
  75. #
  76. # %view -> the command you type will be piped into mc's internal file viewer
  77. #    if you type only the %view and no command, viewer will load %f file
  78. #    instead (i.e. no piping, so it is different to %view cat %f)
  79. #    %view may be directly followed by {} with a list of any of
  80. #    ascii (Ascii mode), hex (Hex mode), nroff (c\bc color highlighting)
  81. #    and unformatted (not highlighting nroff sequences) separated by
  82. #    spaces.
  83. #
  84. # %var -> You use it like this: %var{ENV-VAR:default}.  This macro will expand
  85. #       to the value of the ENV-VAR variable in the environement if it is set
  86. #       otherwise the value in default will be used.  This is similar to
  87. #       the Bourne shell ${VAR-def} construct.  We use it so that the extension
  88. #       file could be used unchanged under some shells that may use different
  89. #       methods of doing this
  90. #
  91. # %q -> will be replaced with a list of files user dropped on it
  92. #    with full pathnames (only applicable in the Drop command).
  93. #
  94. # Target are evaluted from top to bottom (order is thus important).
  95. # If some actions are missing, search continues as if this target didn't
  96. # match (i.e. if a file matches the first and second entry and View action
  97. # is missing in the first one, then on pressing F3 the View action from
  98. # the second entry will be used. default should catch all the actions.
  99. #
  100. # Any handy entries you develop for you are always welcome, if it has
  101. # wider usage than on one system. You can send your modifications to
  102. # via email to mc-devel@roxanne.nuclecu.unam.mx
  103.  
  104. # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
  105.  
  106. regex/\.t([gp]?z|ar\.g?[zZ])$
  107.     Open=%cd tar:%d/%p/
  108.     View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  109.     Extract=gzip -dc %f 2>/dev/null | tar xf -
  110.     Icon=compressed.xpm
  111.  
  112. regex/\.tar\.bz$
  113. #    Open=%cd tar:%d/%p/
  114.     View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
  115.     Extract=bzip -dc %f 2>/dev/null | tar xf -
  116.     Icon=compressed.xpm
  117.  
  118. regex/\.tar\.bz2$
  119.     Open=%cd tar:%d/%p/
  120.     View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
  121.     Extract=bzip2 -dc %f 2>/dev/null | tar xf -
  122.     Icon=compressed.xpm
  123.  
  124. # .tar
  125. shell/.tar
  126.     Open=%cd tar:%d/%p/
  127.     View=%view{ascii} tar tvvf %f
  128.     Extract=tar xf %f
  129.     Icon=tar.xpm
  130.  
  131. # bzipped
  132. regex/\.bz$
  133.     Open=bzip -dc %f | %var{PAGER:more}
  134.     View=%view{ascii} bzip -dc %f 2>/dev/null
  135.     Edit=I=`date +%%s`; export I; bzip -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  136.     Uncompress=bunzip %f
  137.     Icon=compressed.xpm
  138.  
  139. regex/\.bz2$
  140.     Open=bzip2 -dc %f | %var{PAGER:more}
  141.     View=%view{ascii} bzip2 -dc %f 2>/dev/null
  142.     Edit=I=`date +%%s`; export I; bzip2 -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip2 -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  143.     Uncompress=bunzip2 %f
  144.     Icon=compressed.xpm
  145.  
  146. # Programs
  147. shell/rm
  148.     Open=if test ! -d ~/.trash; then mkdir ~/.trash; fi; I=%{Enter file to be safely deleted}; if test -n "$I"; then mv -f -b -V numbered %q ~/.trash; fi
  149.     Icon=rubbish.xpm
  150.     Drop=if test ! -d ~/.trash; then mkdir ~/.trash; fi; mv -f -b -V numbered %q ~/.trash
  151.     Flush=rm -rf ~/.trash
  152.     Title=Safe delete
  153.  
  154. shell/lpr
  155.     Open=lpr %{Enter file(s) to print}
  156.     Icon=printer.xpm
  157.     Drop=lpr %q
  158.     Print=lpr %{Enter file(s) to print}
  159.  
  160. shell/gzip
  161.     Open=gzip %{Enter file to gzip}
  162.     Icon=compressed.xpm
  163.     Drop=gzip %q
  164.  
  165. shell/bzip
  166.     Open=bzip %{Enter file to bzip}
  167.     Icon=compressed.xpm
  168.     Drop=bzip %q
  169.  
  170. shell/bzip2
  171.     Open=bzip2 %{Enter file to bzip}
  172.     Icon=compressed.xpm
  173.     Drop=bzip2 %q
  174.  
  175. shell/gunzip
  176.     Open=gunzip %{Enter file to gunzip}
  177.     Icon=compressed.xpm
  178.     Drop=gunzip %q
  179.  
  180. shell/bunzip
  181.     Open=bunzip %{Enter file to bunzip}
  182.     Icon=compressed.xpm
  183.     Drop=bunzip %q
  184.  
  185. shell/bunzip2
  186.     Open=bunzip2 %{Enter file to bunzip}
  187.     Icon=compressed.xpm
  188.     Drop=bunzip2 %q
  189.  
  190. shell/gdb
  191.     Open=gdb
  192.     Icon=bug.xpm
  193.     Drop=gdb %q
  194.  
  195. # a directory
  196. directory/^\.\.$
  197.     Icon=parent_dir.xpm
  198. directory/^News$
  199.     Icon=news_dir.xpm
  200. directory/^Mail$
  201.     Icon=mail_dir.xpm
  202. directory/^\..*$
  203.     Icon=hidden_dir.xpm
  204. directory/^.*$
  205.     Start XTerm here=cd %p; exec xterm &
  206.     Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
  207.     Icon=plain_dir.xpm
  208.  
  209. # ls-lR
  210. regex/^ls-?lR$
  211.     Open=%cd lslR:%d/%p/
  212.     View=%view{ascii}
  213.     Icon=plain_dir.xpm
  214. regex/^ls-?lR\.(g?z|Z)$
  215.     Open=%cd lslR:%d/%p/
  216.     View=%view{ascii} gunzip -c %f
  217.     Icon=plain_dir.xpm
  218.  
  219. # ftplist
  220. regex/\.ftplist$
  221.     Open=%cd ftplist:%d/%p/
  222.  
  223. # rpm
  224. regex/\.rpm$
  225.     Open=%cd rpm:%d/%p/
  226.     Install this RPM=rpm -i %f
  227.     Upgrade this RPM=rpm -U %f
  228.  
  229. # deb
  230. regex/\.deb$
  231.     Open=%cd deb:%d/%p/
  232.     View=%view{ascii} dpkg-deb -c %f
  233.  
  234. # zip
  235. regex/\.(zip|ZIP)$
  236.     Open=%cd zip:%d/%p/
  237.     View=%view{ascii} unzip -v %f
  238.     Icon=zip.xpm
  239.     Extract=unzip %f
  240.     Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
  241.     Unzip=unzip %f '*'
  242.  
  243. # zoo
  244. shell/.zoo
  245.     Open=%cd zoo:%d/%p/
  246.     View=%view{ascii} zoo l %f
  247.     Icon=zoo.xpm
  248.     Extract=zoo x %f '*'
  249.     
  250. # lha
  251. regex/\.(lha|LHA|lzh|LZH)$
  252.     Open=%cd lha:%d/%p/
  253.     View=%view{ascii} lharc l %f
  254.     Icon=lharc.xpm
  255.     Extract=lharc x %f '*'
  256.     Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
  257.  
  258. # arj
  259. regex/\.a(rj|[0-9][0-9])$
  260.     Open=unarj l %f | %var{PAGER:more}
  261.     View=%view{ascii} unarj l %f
  262.     Icon=zip.xpm
  263.     Extract=unarj x %f '*'
  264.     Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
  265.  
  266. # ar library
  267. regex/\.s?a$
  268.     Open=%cd arfs:%d/%p/
  269.     View=%view{ascii} nm %f
  270.  
  271. # C
  272. shell/.c
  273.     Open=%var{PAGER:more} %f
  274.     View=%view{ascii}
  275.     Compile=%var{CC:cc} -O -c %f
  276.     Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
  277.     Icon=c.xpm
  278.  
  279. shell/.f
  280.     Open=%var{PAGER:more} %f
  281.     View=%view{ascii}
  282.     Compile=f77 -O -c %f
  283.     Compile and Link=f77 -O %f
  284.     
  285. shell/.h
  286.     Open=%var{EDITOR:vi} %f
  287.     Icon=h.xpm
  288.  
  289. shell/.o
  290.     Open=%var{PAGER:more} %f
  291.     Link=%var{CC:cc} -O %f
  292.     Icon=o.xpm
  293.     Display object file symbols=%view{ascii} nm %f
  294.     Disassemble=%view{ascii} objdump -d -r %f
  295.  
  296. shell/.s
  297.     Open=%var{PAGER:more} %f
  298.     Assemble=%var{CC:cc} -O -c %f
  299.     Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
  300.     Icon=s.xpm
  301.  
  302. shell/.dvi
  303.     Open=xdvi %f
  304.     Icon=binary.xpm
  305.     View=xdvi %f
  306.     Convert file to Postscript=dvips %f
  307.  
  308. shell/.tex
  309.     Open=%var{PAGER:more} %f
  310.     Icon=tex.xpm
  311.     TeX this file=tex %f
  312.     LaTeX this file=tex %f
  313.  
  314. shell/^RMAIL$
  315.     Start Emacs on this RMAIL file=emacs %f
  316.     Open=emacs %f
  317.  
  318. regex/\.(te?xi)|(texinfo)$
  319.     Icon=tex.xpm
  320.  
  321. # C++
  322. regex/\.(C|cc)$
  323.     Open=%var{PAGER:more} %f
  324.     View=%view{ascii}
  325.     Compile=c++ -O -c %f
  326.     Link=c++ -O -o %d/`basename %f .c` %f
  327.     Icon=cc.xpm
  328.  
  329. # ar library
  330. regex/\.s?a$
  331.     Open=%view{ascii} ar tv %f
  332.     View=%view{ascii} nm %f
  333.     Icon=a.xpm
  334.  
  335. # .so libraries are not manual pages
  336. regex/\.so\.[0-9\.]*$
  337.     View=%view{hex}
  338.     Icon=so.xpm
  339.  
  340. # Manual page
  341. regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
  342.     Open=nroff  -man %f | %var{PAGER:more}
  343.     View=%view{ascii,nroff} nroff  -man %f
  344.     Icon=man.xpm
  345.  
  346. # Troff with me macros.
  347. shell/.me
  348.     Open=nroff  -me %f | %var{PAGER:more}
  349.     View=%view{ascii,nroff} nroff  -me %f
  350.     Icon=man.xpm
  351.  
  352. # Troff with ms macros.
  353. shell/.ms
  354.     Open=nroff  -ms %f | %var{PAGER:more}
  355.     View=%view{ascii,nroff} nroff  -ms %f
  356.     Icon=man.xpm
  357.  
  358. # Manual page - compressed
  359. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
  360.     Open=gunzip -dc %f | nroff  -man | %var{PAGER:more}
  361.     View=%view{ascii,nroff} gunzip -dc %f | nroff  -man
  362.     Icon=man.xpm
  363.  
  364. regex/(read\.?me$)|(README)
  365.     Icon=info.xpm
  366.  
  367. shell/core
  368.     Icon=core.xpm
  369.  
  370. type/PostScript
  371.     Open=gv %f
  372.     Icon=postscript.xpm
  373.     View with GhostView=gv %f
  374.  
  375. type/GIF\ image
  376.     Open=ee %f
  377.     Icon=gif.xpm
  378.     Include=image-options
  379.     
  380. type/GIF\ picture
  381.     Open=ee %f
  382.     Icon=gif.xpm
  383.     Include=image-options
  384.     
  385. type/JPEG\ picture
  386.     Open=ee %f
  387.     Icon=jpeg.xpm
  388.     Include=image-options
  389.  
  390. type/PC\ bitmap
  391.     Open=ee %f
  392.     Icon=bitmap.xpm
  393.     Include=image-options
  394.  
  395. type/PNG\ image
  396.     Open=ee %f
  397.     Icon=gif.xpm
  398.     Include=image-options
  399.  
  400. type/JPEG\ image
  401.     Open=ee %f
  402.     Icon=jpeg.xpm
  403.     Include=image-options
  404.     
  405. type/TIFF\ file
  406.     Open=ee %f
  407.     Icon=tiff.xpm
  408.     Include=image-options
  409.     
  410. type/PBM
  411.     Open=ee %f
  412.     Icon=pbm.xpm
  413.     Include=image-options
  414.     
  415. type/PGM
  416.     Open=ee %f
  417.     Icon=pgm.xpm
  418.     Include=image-options
  419.     
  420. type/PPM
  421.     Open=ee %f
  422.     Icon=ppm.xpm
  423.     Include=image-options
  424.  
  425. shell/.xbm
  426.     Open=bitmap %f
  427.     Icon=xbm.xpm
  428.  
  429. shell/.xpm
  430.     Open=ee %f
  431.     View=sxpm %f
  432.     Include=image-options
  433.     Icon=xpm.xpm
  434.  
  435. include/image-options
  436.     Set root window to this image=background-properties --setwallpaper %f &
  437.     Display this file=ee %f &
  438.  
  439. # Sound files
  440. shell/.mod
  441.        Open=tracker %f
  442.        Icon=sound.xpm
  443. regex/\.(wav)|(snd)|(voc)|(au)$
  444.        Open=play %f
  445.        Icon=sound.xpm
  446.  
  447. type/FrameMaker
  448.     Open=fmclient -f %f
  449.     Icon=framemaker.xpm
  450.  
  451. type/mail
  452.     Open=elm -f %f
  453.     Icon=mail.xpm
  454.     View=%view{ascii} mcmfmt < %f
  455.  
  456. # gzipped
  457. type/gzip
  458.     Open=gzip -dc %f | %var{PAGER:more}
  459.     View=%view{ascii} gzip -dc %f 2>/dev/null
  460.     Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
  461.     Uncompress=gunzip %f
  462.     Icon=compressed.xpm
  463.  
  464. type/compress
  465.     Open=gzip -dc %f | %var{PAGER:more}
  466.     View=%view{ascii} gzip -dc %f 2>/dev/null
  467.     Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
  468.     Icon=compressed.xpm
  469.  
  470. # Makefile
  471. regex/[Mm]akefile
  472.     Open=make -f %f %{Enter parameters}
  473.     Icon=makefile.xpm
  474.  
  475. shell/Imakefile
  476.     Open=xmkmf -a
  477.     Icon=makefile.xpm
  478.  
  479. type/PDF
  480.     Open=xpdf %f
  481.  
  482. # Executables
  483. type/executable
  484.     Open=./%f
  485.     View=%view
  486.     Drop=%f %q
  487.     Execute in XTerm=xterm -e %f &
  488.     View Required Libraries=%view{ascii} ldd %f
  489.     Strip binary=strip %f
  490.     Icon=application.xpm
  491.  
  492. # MPegs
  493. regex/\.mpe?g$
  494.     Open=mpeg_play %f &
  495.     View (big)=mpeg_play -dither 2x2 %f &
  496.     View (gray)=mpeg_play -dither gray %f &
  497.  
  498. # HTML
  499. regex/\.html?$
  500. #    Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
  501.     Open=if [ x$DISPLAY = x ]; then lynx -force_html %f; else (lynx %f &); fi
  502.     View=%view{ascii} lynx -dump -force_html %f; 
  503.     Icon=html.xpm
  504.     Run with AppletViewer=appletviewer %f
  505.     View with lynx=lynx file://%f
  506.  
  507. # rar
  508. regex/\.[rR]([aA][rR]|[0-9][0-9])$
  509.     Open=%cd rar:%d/%p/
  510.     View=%view{ascii} rar v -c- %f
  511.     Extract=rar x -c- %f '*'
  512.     Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
  513.  
  514. # dbf
  515. regex/\.(dbf|DBF)$
  516.        Open=%view{ascii} dbview %f
  517.        View=%view{ascii} dbview -b %f
  518.  
  519. # wav
  520. regex/\.(wav|WAV)$
  521.        Open=vplay %f
  522.        Icon=wav.xpm
  523.  
  524. # wav22
  525. regex/\.(wav22|WAV22)$
  526.        Open=vplay -s 22 %f
  527.        Icon=wav.xpm
  528.  
  529. # REXX script
  530. regex/\.(rexx)|(rex)|(cmd)$
  531.        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
  532.        Icon=rexx.xpm
  533.  
  534. # Microsoft Word Document
  535. regex/\.(doc|DOC)$
  536. #       View=%view{ascii} catdoc -w %f
  537.        View=%view{ascii} word2x -f text %f -
  538.        Icon=word.xpm
  539. type/Microsoft Word Document
  540. #       View=%view{ascii} catdoc -w %f
  541.        View=%view{ascii} word2x -f text %f -
  542.        Icon=word.xpm
  543.  
  544. # cpio rules
  545.  
  546. shell/.cpio.Z
  547.     Open=%cd cpio:%d/%p/
  548.     View=%view{ascii} compress -dc '%f' | cpio -ictv
  549.     Extract=compress -dc '%f' | cpio -ic
  550.     Icon=compressed.xpm
  551.  
  552. shell/.cpio.gz
  553.     Open=%cd cpio:%d/%p/
  554.     View=%view{ascii} gzip -dc '%f' | cpio -ictv
  555.     Extract=gzip -dc '%f' | cpio -ic
  556.     Icon=compressed.xpm
  557.  
  558. shell/.cpio
  559.     Open=%cd cpio:%d/%p/
  560.     View=%view{ascii} cat '%f' | cpio -ictv
  561.     Extract=cat '%f' | cpio -ic
  562.     Icon=cpio.xpm
  563.  
  564.  
  565.  
  566. # Default target for anything not described above
  567. default/*
  568.     Open=
  569.     View=%view{ascii}
  570.     Drop=
  571.     Icon=plain.xpm
  572.     Title=%p
  573.